   <!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <title>申请退款</title>
    <link rel="stylesheet" href="../style/common.css" />
    <link rel="stylesheet" href="../style/orders.css" />
    <script src="../js/write.js" ></script>
</head>
<body>

<header class="common-header">
    <div class="common-header-container">
        <a href="javascript:history.back()" class="common-header-return">  </a>
        <h1 class="common-header-title">申请退款</h1>
        <!--<a href="#" class="common-header-operational"> cannel </a>-->
    </div>
</header>

<section class="common-container bg-gray clearBottom padtop10">

    <div class="orders-refund-message">

        <div class="refund-message-add">
            <h3>请选择快递公司名称<span>*</span></h3>
            <select id="trackname" name="trackname">
                <option value="圆通">圆通</option>
                <option value="中通">中通</option>
                <option value="韵达">韵达</option>
                <option value="百世汇通">百世汇通</option>
                <option value="申通">申通</option>
            </select>
        </div>

        <div class="refund-message-add">
            <h3>请输入快递单号<span>*</span></h3>
            <input type="text" id="tracknumber" name="tracknumber" />



        </div>

        <div class="refund-message-add">
            <h3>请上传快递单凭证<span>*</span></h3>

            <div class="refund-msg-filestype">
                <input type="file" id="trackfile" name="trackfile" class="trackfile" />
            </div>

        </div>

        <input type="button" id="submit" name="submit" class="refund-msg-submit" value="上传信息" />
        <input type="hidden" id="hidden" value='{"shippingAddress":"北京市海淀区紫竹院路69号中国兵器大厦裙楼1层","consignee":"北京银河宇科技股份有限公司","consigneePhone":"010-53632810"}' />

    </div>


</section>

<script>

    $(function(){


        $("#submit").on("click",function(){

            var per = JSON.parse($("#hidden").val());
            console.log(per);

            var obj = {
                body:{
                    orderId:getUrlEn().orderId,
                    expressNumber: $("#tracknumber").val(),
                    expressCompany: selectValue("#trackname"),
                    orderExpressVoucher: $("#trackfile").val(),
                    shippingAddress: per.shippingAddress,
                    consignee: per.consignee,
                    consigneePhone: per.consigneePhone,
                }

            }

            console.log(obj);
            postLogistics(obj,function(data){

                if(data.head.code == 1){
                    window.location = "../orderList.html";
                }

            })



        })
    })


    function postLogistics(obj,callback){

        var postLogistics = {
            url:urlGather.postLogistics,
            success:function(data){
                callback(data);
            },
            error:function(){}
        }

        var objects = {
            head : {
                crossDomain : "cross_postLogistics"
            }
        };


        objects.head = obj.head ?  obj.head : objects.head;
        objects.body = obj.body ? obj.body : {};
        var req = RequestData( objects );
        req.getAjax( postLogistics );

    }



</script>





<script>
$(function(){



})
</script>

</body>
</html>